-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use timeout_in_minutes for Terraform timeout in AWS CloudFormation #5712
Conversation
@@ -143,7 +149,7 @@ func resourceAwsCloudFormationStackCreate(d *schema.ResourceData, meta interface | |||
wait := resource.StateChangeConf{ | |||
Pending: []string{"CREATE_IN_PROGRESS", "ROLLBACK_IN_PROGRESS", "ROLLBACK_COMPLETE"}, | |||
Target: []string{"CREATE_COMPLETE"}, | |||
Timeout: 30 * time.Minute, | |||
Timeout: time.Duration(int64(timeout)) * time.Minute, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would have been cleaner to start with int64
variable instead of casting it later.
Not that I would be worried about minutes going over 32bits, but strictly speaking we might potentially end up comparing int32 with int64 in the condition above.
i.e. this
timeout := 30
can be turned into
retryTimeout := int64(30)
and the line here can be turned into
Timeout: time.Duration(retryTimeout) * time.Minute,
as hinted above, I'd also suggest renaming the timeout
variable to more specific retryTimeout
.
Hi @andrewtarry I left you one comment there regarding data type and variable name. One last thing, before we merge this (and I'm aware I might be asking for too much - depending on your git skills) - would you mind squashing all 3 commits into a single one using |
updated cloudformation timeout to use timeout_in_minutes if greater than 30 minutes set the retry timeout as int64 when created
Hi @radeksimko Thanks for your comments. I have removed the extra casting as you suggesting and rebased the commits. Travis seems to be failing but it looks like it's a issue between Travis and github. |
Use timeout_in_minutes for Terraform timeout in AWS CloudFormation
@andrewtarry FYI for the future, it might make your life easier if you create a PR from a feature/bugfix branch, not from |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
We recently encountered a problem with the CloudFormation resource due to the timeout_in_minutes value being increased. If the CloudFormation timeout is increased Terraform will timeout after 30 minutes resulting an error and other resources not being applied but CloudFormation carries on building.
This change leave the default timeout at 30 minutes but if the timeout_in_minutes is greater than 30 the timeout becomes timeout_in_minutes + 5 minutes (just to make sure it will have finished or failed)